#pragma once

#include "event.h"



namespace Hazel{

    class HAZEL_API KeyEvent : public Event
    {
    public:
        inline int GetKeyCode() const {return m_Keycode;}

        EVENT_CLASS_CATEGORY(((int)EventCateGory::EventCategoryKeyboard | (int)EventCateGory::EventCategoryInput))
    protected:
        KeyEvent(int keycode)
            :m_Keycode(keycode) {}
        int m_Keycode;
    };

    class HAZEL_API KeyPressedEvent : public KeyEvent
    {
    public:
        KeyPressedEvent(int keycode,int repeatCount)
            :KeyEvent(keycode),m_RepeateCount(repeatCount) {}
        
        inline int GetRepeatCount() const {return m_RepeateCount;}

        std::string ToString() const override
        {
            std::stringstream ss;
            ss<<"KeyPressedEvent: "<<m_Keycode<<", ("<<m_RepeateCount<<") repeates";
            return ss.str();
        }

        EVENT_CLASS_TYPE(KeyPressed)
    private:
        int m_RepeateCount;
    };

    class HAZEL_API KeyReleasedEvent : public KeyEvent
    {
    public:
        KeyReleasedEvent(int keycode)
            :KeyEvent(keycode) {}

        std::string ToString() const override
        {
            std::stringstream ss;
            ss<<"KeyReleasedEvent: "<<m_Keycode;
            return ss.str();
        }

        EVENT_CLASS_TYPE(KeyReleased)
    };

    class HAZEL_API KeyTypedEvent : public KeyEvent
    {
    public:
        KeyTypedEvent(int keycode)
            :KeyEvent(keycode) {}
        
        std::string ToString() const override
        {
            std::stringstream ss;
            ss<<"KeyTypedEvent: "<<m_Keycode;
            return ss.str();
        }

        EVENT_CLASS_TYPE(KeyTyped)
    };
}